home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ian & Stuart's Australian Mac 1
/
Ian and Stuart's One (Australia).iso
/
Australasian Legends
/
Commercial
/
Rainbow Hill
/
MacDOS™ 2.0.0
/
User's Guide
/
03 Data on the Mac
< prev
next >
Wrap
Text File
|
1994-09-20
|
11KB
|
222 lines
3 Data on the Mac
The purpose of this section of the User's Guide is to
introduce you to how the Macintosh Operating System
organises data. Nevertheless, many functions are left out
because they have no visible effect on MacDOS (although
MacDOS itself is aware of them!). To have a full and
detailed description of the Macintosh File Manager, you
should refer to Apple's Inside Macintosh volume series.
Volumes and Drives
Inside Macintosh Vol II defines a volume as a piece of
storage medium [...] formatted to contain files. Removable
media like floppies are volumes.
When you introduce a floppy into the floppy drive, the Mac
OS assigns to it a Volume Reference Number and forms a
volume record to store information about the floppy. The
volume is then said to be "mounted" and "on-line".
When the floppy is trashed, the Mac OS frees the Volume
Reference Number and the memory containing the volume
record. The volume is then said to be "unmounted" and the
Mac OS completely forgets the floppy. Only volumes which
are on-line are fully accessible by applications.
When you eject the floppy (ie. when you type cmd-E and the
icon becomes grey), the Mac OS releases most of the
information concerning the floppy but retains the Volume
Reference Number. The volume is then said to be "mounted"
but "off-line". When an application tries to access a
volume which is off-line, the Mac OS asks you to re-insert
the floppy, so that it can be placed back on-line.
If you boot a Mac from a hard disk, insert one floppy,
eject it with cmd-E, and then insert a second floppy, the
Mac OS assigns VRefNum 1 to the startup disk, 2 to the
first floppy, and 3 to the second.
If you then unmount volume 2 by trashing the icon of the
first floppy, the Mac OS frees VRefNum 2 but does not re-
arrange the numbers. Therefore, the second floppy remains
volume 3.
Finally, if you eject with cmd-E the second floppy instead
of trashing it and then insert another floppy, the Mac OS
re-uses VRefNum 2. In other words, the same Volume
Reference Number can be assigned to different floppies at
different times.
A drive is the physical device on which you can mount a
volume (eg. a floppy disk drive). At startup, the Mac OS
assigns Drive Numbers to all drives and never changes them
thereafter. For instance, the internal floppy drive is
always drive 1, the external floppy drive is drive 2, and
so on. Most Operating Systems (including DOS) operate on
Drive Identifiers (the A:, C:, etc of DOS, which are
effectively equivalent to the Macintosh Drive Numbers).
Beside never changing, a Drive Number also remains valid
regardless of whether a floppy is ever mounted on the drive
or not.
Especially if you are an experienced DOS user, it is
important that you fully understand the differences between
the two concepts of "volume" and "drive".
Folders
A folder is a collection of files and other folders.
You can use folders as if they really contained files, and
the desktop metaphor reinforces this view. Nevertheless,
folders are more like a telephone directory, in that they
contain the information necessary to find the files (ie.
the people) rather than the files themselves. This is why
it is so quick to move files from one folder to another:
the files remain where they are and only a short directory
entry is moved.
This misconception of folders actually containing files
leads to the concept of a "folder size". In reality,
folders have no size of their own. If you work with System
7.0, try this: empty the Trash, create an empty folder,
trash it, and then empty the Trash once more. The Mac OS
will display a dialog box saying: The Trash contains 1
item. It uses zero K of disk space ...
A folder name can contain up to 31 characters and most
ASCII characters are accepted.
Files
Again from Inside Macintosh Vol II: A file is a finite
sequence of numbered bytes.
Macintosh files can consist of two parts called forks: the
data fork and the resource fork. These two parts have
different functions and are usually accessed separately.
The resource fork is the structured part of a file and
contains objects like menus, fonts, icons, pictures, and
code. All application files have a resource fork. In fact,
most applications have no data fork at all.
The data fork is the unstructured part of a file and
contains data used by applications, like text, database
records, and format preferences. Many document files
contain a data fork but no resource fork.
File Names
A file name can contain up to 31 characters and most ASCII
characters are accepted.
File Updates
For each file, the Mac OS remembers the date and time of
its last update. Files are only considered updated when
their content is changed. Therefore, operations like
renaming, changing of attributes, moving, and copying do
not modify the date and time of the last update.
File Finder Attributes
The Mac OS keeps data concerning the appearance of files on
the desktop. This information is stored in records called
"Finder Info"s, and each file has its own FInfo record. The
fields which you need to know in order to work with MacDOS
are:
File Creator
The Creator of an application identifies the application
itself. The Creator of a document identifies the
application which created it. In practical terms, the
Creator of a document determines which application is
launched when you double click on the document icon.
All creators are registered with Apple, so that they are
unique. They consist of four characters and are case
sensitive. For instance, MacDOS' creator is 'mDOS' and
Teach Text's is 'ttxt'. The Creator '????' is often used
to identify files which were created by unregistered
applications.
File Type
The Type of a file identifies its function. It consists
of four characters and is case sensitive.
Apple has defined some standard types which many
applications use. For example: plain ASCII files are of
type 'TEXT' and applications are of type 'APPL'. In
addition, many applications define special file types
for their own use.
The Finder uses Creator and File Type to determine what
icon to display for a particular file.
Creators & Types Relevant for MacDOS
• Creator 'mDOS'; type 'APPL'
The MacDOS application file.
• Creator 'mFLR'; type 'APPL'
Applications that can operate as MacDOS extensions and
interact with MacDOS through pipes.
• Creator 'ToyS'; type 'TEXT'
Text AppleScripts that can be executed.
• Creator 'mDOS'; type 'TEXT'
Batch files that can automatically launch MacDOS when
double-clicked.
• Creator 'ttxt'; type 'TEXT'
Text files created by TeachText. By default, MacDOS
creates all text files with this creator.
• Creator 'hhgg'; type 'INIT'
File sharing extension, to be switched off before
quitting the Finder.
• Creator 'MACS'
The creator of the Finder.
• Type 'APPL'
Generic applications that can be launched.
• Type 'osas'
Compiled AppleScripts than can be executed.
• Type 'TEXT'
Generic text files used for I/O redirection or to be
executed as batch files from within MacDOS.
Hidden Flag
Within the FInfo record, a flag determines whether the
icon of the file is to be displayed on the desktop or
not. This flag is used to protect system files and other
files which should not be accessed with the mouse during
normal operations.
Usually, you can access the hidden flag through special
applications like ResEdit. MacDOS lets you list hidden
files and work with them. It also lets you easily toggle
the hidden flag with the command REN/H.
Aliases
Aliases are files which store the location of other items
like files, folders, and floppies. Apple introduced them
with System 7.0 .
In most cases, you can use an alias as if it were the
corresponding target, because the Mac OS hides the
connection and automatically refers to the target.
The way in which MacDOS handles aliases can be summarised
as follows:
• The DIR command, which lists the contents of a
folder, handles aliases as if they were normal files
except when the user applies the command to a single
aliased folder. In that case, DIR resolves the alias and
lists the contents of the target folder. In lists of
filenames, aliases produce double entries which provide
information on both the alias itself and the target.
• Commands which operate on files always handle
aliases like files, so that aliases can be renamed,
copied, and deleted like normal files, regardless of
whether they have as target a file or a folder.
• Commands which operate on folders fail when applied
to an aliased folder, with one exception: CHDIR applied
to an aliased folder resolves the alias and sets the
default directory to be the target folder.